package me.sdevil507.biz.fruit.service;


import com.querydsl.core.types.Predicate;
import me.sdevil507.biz.fruit.dto.*;
import me.sdevil507.biz.fruit.po.*;
import me.sdevil507.biz.screen.dto.ScreenSearchConditionDTO;
import me.sdevil507.supports.jpa.PageParamsDTO;
import me.sdevil507.supports.jpa.SortParamsDTO;
import me.sdevil507.supports.upload.po.AttachFile;
import org.springframework.data.domain.Page;

import java.util.HashMap;
import java.util.List;
import java.util.Set;

public interface FruitService {

    void setBusinessId(FruitParamsDTO fruitParamsDTO);

    void setBusinessId(FruitDTO dto);

    Page<ResultListFruitDTO> readAllFruitByPage(FruitDTO searchDto, PageParamsDTO pageDto, SortParamsDTO sortDto);

    Page<ResultListFruitDTO> readAllHomeFruitByPage(FruitDTO searchDto, PageParamsDTO pageDto, SortParamsDTO sortDto);

    Page<ResultListFruitDTO> readAllHomeFruitOfSearchByPage(FruitParamsDTO fruitParamsDTO);

    List<ResultListFruitDTO> readAll(FruitDTO searchDTO,  SortParamsDTO sortParamsDto);

    List<ResultTagFruitDTO> readAllTagFruitList(FruitDTO searchDTO);

    FruitPO findOneById(long id);

    FruitPO findIsExistFruit(FruitDTO dto);

    Integer readAllOrgSpecialFruitFeedBackCount(FruitDTO searchDto);

    List<FruitFeedBackPO> getOneFruitFeedBackByFruitId(FruitFeedBackPO fruitFeedBackPO);

    void updateFruitFeedBackByFruitId(FruitFeedBackPO fruitFeedBackPO);

    Page<ResultWaitCheckFruitDTO> readAllOrgFruitWaitingCheckByPage(FruitDTO searchDto, PageParamsDTO pageDto, SortParamsDTO sortDto);

    Page<FruitPO> searchFruitNotInProjectData(FruitDTO searchDto, PageParamsDTO pageDto, SortParamsDTO sortDto);

    boolean isHaveBsJSSWXCB(List<FruitSubPO> fruitSubPOList);

    void orgCreate(FruitDTO fruitDTO);

    void subNcToSpecial(FruitDTO fruitDTO);

    void orgDelete(Long id);

    List<FruitPO> readAllOrgFruit(FruitDTO searchDto, SortParamsDTO sortDto);

    Boolean getFruitByAuthorId(Long id);

    HashMap<String, Object> getOrgHomePercentData(FruitDTO fruitDTO);

    List<FruitAuthorPO> getFruitAuthorById(Long id);

    void createFruitOrgOrExpertRel(Long orgId, Long userId, Long fruitId, Long initFruitId, String status);

    void expertCreate(FruitDTO dto);

    void expertDelete(Long id);

    List<FruitPO> getCheckFruits(FruitDTO searchDTO);

    void deleteFruitOrgRelPosByFruitIdAndOrgIdAndStatus(long fruitId, long orgId, String status);

    Predicate getPredicates(QFruitPO qFruitPO, FruitDTO searchDTO);

    HashMap<String, Object> getExpertHomePercentData(FruitDTO fruitDTO);

    HashMap<String, Object> getExpertHomeLineData(FruitDTO fruitDTO);

    HashMap<String, Object> getExpertRelationData(FruitDTO fruitDTO);

    Page<ResultListFruitDTO> readAllOrgSpecialFruitByPage(FruitDTO searchDto, PageParamsDTO pageDto, SortParamsDTO sortDto);

    List<ResultServicesHomeListFruitDTO> readAllServicesFruitList(FruitParamsDTO fruitParamsDTO);

    Page<ResultServicesHomeListFruitDTO> readAllServicesFruitByPage(FruitParamsDTO fruitParamsDTO);

    List<ResultServicesHomeListFruitDTO> readAllServicesSpecialFruitList(FruitParamsDTO fruitParamsDTO);

    long readAllFruitByTopicId(Long id);

    List<FruitPO> readAllFruitByProjectId(Long projectId);

    void acceptSpecial(FruitPO fruitPo, FruitSubPO fruitSubPO);

    void refuseSpecial(FruitPO fruitPo);

    void revocationSpecial(FruitPO fruitPo);

    void inputPsSpecial(FruitLeaderPO fruitLeaderPO);

    void deletePsSpecial(FruitLeaderPO fruitLeaderPO);

    ResultServicesHomeListFruitDTO getFruitInfoAndOrgInfoById(Long fruitId);

    long getFruitSubPiece(String subType, ScreenSearchConditionDTO dto);

    long getFruitPsPiece(ScreenSearchConditionDTO dto);

    long getFruitPsZgjPiece(ScreenSearchConditionDTO dto);

    long getFruitPsFgjPiece(ScreenSearchConditionDTO dto);

    Page<ResultHomeListFruitDTO> getAllFruitOfPageByOrgId(FruitParamsDTO dto);

    void inputSpecialFk(FruitFeedBackPO fruitFeedBackPO);

    void deleteSpecialFk(FruitFeedBackPO fruitFeedBackPO);

    void saveBsInfo(long fruitId);

    void orgAddSpecialData(FruitPO fruitPo, Long orgId);

    Page<ResultServicesReportInfoDTO> readAllReportInformationByPage(FruitParamsDTO dto);

    void createFruitWxAppletSimple(FruitWxAppletPO newPo);
}
